<script setup lang="ts">
import TabBar from "./TabBar.vue";
import { useRoute } from "vue-router";
import { watch, ref, onMounted } from "vue";

const route = useRoute();
let title: any = ref("");

watch(
  route,
  (val) => {
    // console.log(val.meta);
    title.value = val.meta.title || "";
  },
  { immediate: true }
);
</script>

<template>
  <!-- 标题 -->
  <van-sticky>
    <van-nav-bar :title="title" />
  </van-sticky>
  <!-- 内容区域 -->
  <router-view></router-view>
  <!-- 底部导航栏 -->
  <TabBar />
</template>

<style scoped lang="scss">
::v-deep{
//  .van-index-anchor--sticky {
//   top: 92px;
// }
}
</style>